package com.eui.demo.application
{
	import com.eui.demo.demonodes.model.HomePM;
	import com.eui.demo.demonodes.model.ParameterPM;
	import com.eui.demo.demonodes.model.UnsavedChangePM;
	import com.eui.demo.demonodes.view.HomeView;
	import com.eui.demo.demonodes.view.ParameterView;
	import com.eui.demo.demonodes.view.UnsavedChangeView;
	import com.eui.demo.demowizard.DemoWizardPM;
	import com.eui.demo.demowizard.DemoWizardView;
	import com.eui.demo.designwizard.DesignWizardPM;
	import com.eui.demo.designwizard.DesignWizardView;
	import com.eui.demo.logwizard.LogWizardPM;
	import com.eui.demo.logwizard.LogWizardView;
	import com.eui.arch.application.model.ApplicationPM;
	import com.eui.arch.util.PMContext;

	import flash.utils.getQualifiedClassName;

	public class DemoApplicationPM extends ApplicationPM
	{
		public static const MANAGED_PM_ID:String=getQualifiedClassName(DemoApplicationPM);

		public static const HOME_NODE:String="Home";
		public static const PARAMETER_NODE:String="Parameter";
		public static const UNSAVEDCHANGE_NODE:String="UnsavedChange";
		public static const DEMO_WIZARD:String="DemoWizard";
		public static const DESIGN_WIZARD:String="DesignWizard";
		public static const LOG_WIZARD:String="LogWizard";

		public static function getInstance():DemoApplicationPM
		{
			return PMContext.getInstance().getPM(MANAGED_PM_ID) as DemoApplicationPM;
		}


		override public function pmId():String
		{
			return MANAGED_PM_ID;
		}

		public function DemoApplicationPM()
		{
			super();
		}

		override protected function initNodes():void
		{
			addNode(HOME_NODE, HomePM, HomeView, 0);
			addNode(PARAMETER_NODE, ParameterPM, ParameterView, 1);
			addNode(UNSAVEDCHANGE_NODE, UnsavedChangePM, UnsavedChangeView, 2);
			addNode(DEMO_WIZARD, DemoWizardPM, DemoWizardView);
			addNode(DESIGN_WIZARD, DesignWizardPM, DesignWizardView);
			addNode(LOG_WIZARD, LogWizardPM, LogWizardView);
		}

		public function navToNodeClassDiagramInDesignWizard():void
		{
			var data:Object=new Object();
			data.stepName="Node class diagram";
			navToNodeByName(DESIGN_WIZARD, data);
		}
	}
}